home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
rtextu10.zip
/
FMT.DOC
< prev
next >
Wrap
Text File
|
1993-05-06
|
10KB
|
278 lines
#######
# # # #####
# ## ## #
##### # ## # #
# # # #
# # # #
# # # #
You can get part of the following documentation by invoking the program with
the switches -v, -h, or -H . See README.TXT for more information.
----------------------------------- -v ------------------------------------
FMT v1.0 -- ASCII text formatter
Copr (c) 1992,1993 Richard Breuer. FMT is freeware. No warranties.
This is FMT/2 v1.0 - renamed to FMT (from RUTILS 4).
Author: Richard Breuer
Brunssumstrasse 6
5100 Aachen
(after Jul 1, 1993: 52074 Aachen)
Germany
Europe
Phone: +49/241/85605
Fax: +49/241/8021329
Email: ricki@pool.informatik.rwth-aachen.de (Preferred!)
----------------------------------- -h ------------------------------------
FMT v1.0 -- ASCII text formatter
Copr (c) 1992,1993 Richard Breuer. FMT is freeware. No warranties.
Usage:
FMT [-BcCfhHLnpRsv*] [-<n>] infile.. [{>|>>} outfile]
Options:
-<n> Fill output lines to up to n columns, default is n=72
-B Blockset mode. Fill lines up with spaces
-c Crown margin mode. Preserve the indentation of the first two lines
within a paragraph, and align the left margin of each subsequent line
with that of the second line. Useful for tagged paragraphs
-C Center lines
-f Make text float around indentation changes within paragraphs
-h Display this help screen
-H Display another help screen with notes and examples
-L Left align lines (default)
-n Do not preserve indentation of follow-up lines
-p Try to preserve the spacing within lines
-R Right align lines
-s Split lines only. Do not join short lines to form longer ones
-v Display version info and information about the author
-* Display internal information (for debugging purposes)
----------------------------------- -H ------------------------------------
FMT v1.0 -- ASCII text formatter
Copr (c) 1992,1993 Richard Breuer. FMT is freeware. No warranties.
Notes:
FMT reads from stdin if a filename is -. The output is always directed
to stdout. The line lengths are restricted to 255 characters. Longer lines
will be cut. The errorlevel is set to 1 if help has been displayed. It is
set to 255 in case of an error and 0 on normal completion. Output resulting
from multiple input files is appended to stdout. The processing order for
wildcards depends on the order of the directory entries. FMT returns
nonsense for binary files. Blank lines are preserved. FMT does not fill
lines beginning with ".", for compatibility with nroff. Note that TAB
characters may lead to unexpected results! A PARAGRAPH is defined as a
range of lines bounded by empty lines or file boundaries.
Examples:
FMT *.TXT
Formats all TXT files in the current directory to a width of 72 columns.
!}FMT -B
When invoked from VI (or a clone like ELVIS), '!}FMT -B' will work as
a filter and blockset the current paragraph.
-------------------------------------------------------------------------------
Additional information:
FMT is an advanced re-implementation of the Unix FMT command. It offers
four substantially different modes of text formatting: Left aligned -L,
Right aligned -R, blockset (left and right aligned) -B, and centered -C
text.
How FMT works:
This section gives a detailed description of how FMTs options work. Each
switch is accompanied by an example text to illustrate the function.
-B Switches to blockset mode. In this mode the text is aligned to the
left AND the right margin. This is achieved by inserting spaces in
the text. These spaces are inserted at the positions where there
are already spaces in the line. The positions are chosen randomly.
> Let this be an example text which<
> is to be formatted.<
> At this position the indentation changes!<
FMT -B15 formats it as follows:
> Let this be<
> an example<
> text which<
> is to be<
> formatted.<
> At this<
> position<
> the<
> indentati<
> on<
> changes!<
Let's take a close look at the result and mark some points:
(1) Some spaces have been removed, others have been inserted. This
has something to do with the so-called 'space simplification'
which first turns all double spaces into single ones before
the new spaces are filled in.
(2) The word indentati|on is truncated and wrapped into the next
line. The reason is, of course, that it does not fit in the
first line.
(3) The indentation change in the original text makes FMT open a
new paragraph. The old one is ended (you see, that the last
line is not left- and right-aligned), the new one started.
Another way to end a paragraph are empty lines.
-c Crown margin mode. This option has the following effect:
> THIS IS AN EXAMPLE:<
> Let this be an example text which<
> is to be formatted.<
> At this position the indentation changes!<
FMT -cB30 produces the following result:
> THIS IS AN EXAMPLE:<
> Let this be an example text<
> which is to be formatted.<
> At this position the<
> indentation changes!<
You see that the header line makes kind a of an own paragraph.
-C Center lines. The effect of this option is as follows:
> Let this be an example text which<
> is to be formatted.<
> At this position the indentation changes!<
FMT -C15 formats it as follows:
> Let this be<
> an example<
> text which<
> is to be<
> formatted.<
> At this<
> position<
> the<
> indentati<
> on<
> changes!<
The first paragraph (until "formatted.") is centered within the range
of columns 4 to 15 (15, because of the command argument -15; 4, because
the indentation is 3 spaces). The second is centered in 7..15.
-f Make text float around indentation changes within paragraphs. This
means that, if the indentation changes and a new paragraph is opened,
the old paragraph is filled up before the new one starts:
> Let this be an example text which<
> is to be formatted.<
> At this position the indentation changes!<
FMT -f20 formats it as follows:
> Let this be an<
> example text<
> which is to be<
> formatted. At<
> this position<
> the<
> indentation<
> changes!<
You see that the word "At" is put in the last line of the first
paragraph, before the second is started.
-L Left alignment. This is the default. See the example above (the only
difference is that the word "At" goes in paragraph #2.
-n Do not preserve indentation of follow-up lines. This options means that
only empty lines end paragraph, while indentation changes do not. For
our example this means:
> Let this be an example text which<
> is to be formatted.<
> At this position the indentation changes!<
FMT -f20 formats it as follows:
> Let this be an<
> example text<
> which is to be<
> formatted. At<
> this position the<
> indentation<
> changes!<
The indentation change does not matter, all is formatted as if it were
one paragraph. This option will produce nice results, if you have a
text with a ragged left margin.
-p Try to preserve the spacing within lines. Our exa